package com.evil.kingdom.pojo.entity.person.king;

import com.evil.common.mongo.entity.SingleName;
import com.evil.kingdom.pojo.entity.person.base.PersonType;
import com.evil.kingdom.pojo.entity.person.base.Person;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.HashSet;
import java.util.Set;

/**
 * 君主
 *
 * @author liyang
 * @date 2024-06-04 18:18
 */
@Getter
@Setter
@Document
public class King implements SingleName, PersonType {

    /**
     * 名称
     *
     * @see Person#getName()
     */
    @Id
    @NotBlank(message = "名称不能为空")
    private String name;

    /**
     * 士兵
     */
    private Set<String> soldiers;

    /**
     * 武将列表
     */
    private Set<String> generals;

    public King() {
        soldiers = new HashSet<>();
        this.generals = new HashSet<>();
    }

    @Override
    public String getEntityName() {
        return "君主";
    }
}
